package com.ruoyi.procurementmanagement.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.procurementmanagement.mapper.PurchasePriceHistoryMapper;
import com.ruoyi.procurementmanagement.domain.PurchasePriceHistory;
import com.ruoyi.procurementmanagement.service.IPurchasePriceHistoryService;

/**
 * 采购价格历史Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-27
 */
@Service
public class PurchasePriceHistoryServiceImpl implements IPurchasePriceHistoryService 
{
    @Autowired
    private PurchasePriceHistoryMapper purchasePriceHistoryMapper;

    /**
     * 查询采购价格历史
     * 
     * @param id 采购价格历史主键
     * @return 采购价格历史
     */
    @Override
    public PurchasePriceHistory selectPurchasePriceHistoryById(Long id)
    {
        return purchasePriceHistoryMapper.selectPurchasePriceHistoryById(id);
    }

    /**
     * 查询采购价格历史列表
     * 
     * @param purchasePriceHistory 采购价格历史
     * @return 采购价格历史
     */
    @Override
    public List<PurchasePriceHistory> selectPurchasePriceHistoryList(PurchasePriceHistory purchasePriceHistory)
    {
        return purchasePriceHistoryMapper.selectPurchasePriceHistoryList(purchasePriceHistory);
    }

    /**
     * 新增采购价格历史
     * 
     * @param purchasePriceHistory 采购价格历史
     * @return 结果
     */
    @Override
    public int insertPurchasePriceHistory(PurchasePriceHistory purchasePriceHistory)
    {
        purchasePriceHistory.setCreateTime(DateUtils.getNowDate());
        return purchasePriceHistoryMapper.insertPurchasePriceHistory(purchasePriceHistory);
    }

    /**
     * 修改采购价格历史
     * 
     * @param purchasePriceHistory 采购价格历史
     * @return 结果
     */
    @Override
    public int updatePurchasePriceHistory(PurchasePriceHistory purchasePriceHistory)
    {
        return purchasePriceHistoryMapper.updatePurchasePriceHistory(purchasePriceHistory);
    }

    /**
     * 批量删除采购价格历史
     * 
     * @param ids 需要删除的采购价格历史主键
     * @return 结果
     */
    @Override
    public int deletePurchasePriceHistoryByIds(Long[] ids)
    {
        return purchasePriceHistoryMapper.deletePurchasePriceHistoryByIds(ids);
    }

    /**
     * 删除采购价格历史信息
     * 
     * @param id 采购价格历史主键
     * @return 结果
     */
    @Override
    public int deletePurchasePriceHistoryById(Long id)
    {
        return purchasePriceHistoryMapper.deletePurchasePriceHistoryById(id);
    }
}
